package cn.kgc.jdbc.service;

import cn.kgc.jdbc.dao.UserDao;
import cn.kgc.jdbc.dao.UserDaoImpl;
import cn.kgc.jdbc.entity.User;

/**
 * @author: mosin
 * @version: v1.0  2022/4/23
 */
public class UserServiceImpl  implements UserService{

    private UserDao userDao  = new UserDaoImpl() ;
    @Override
    public boolean login(User user) {
        //根据用户名和密码 做查询操作
        User usr = userDao.selectUser(user);
        return usr!=null;
    }

    @Override
    public boolean register(User user) {
        //根据用户名和密码 做添加操作
        int line = userDao.addUser(user);
        return line>0;
    }
}
